import paddlehub as hub
import cv2
import imp, sys, os

test_img_path = ["./img_1.png"]
np_images = [cv2.imread(image_path) for image_path in test_img_path]
module = hub.Module(name="resnet50_vd_animals")
results = module.classification(images=np_images)
for result in results:
    print(result)
# """ 你的 APPID AK SK """
# APP_ID = '29080575'
# API_KEY = 'B7hXkDznRl5gmM09Mjxt4mWj'
# SECRET_KEY = 'eyVmboIWWDBmUr3AzScq7MEAhYVIaGGL'
#
# client = AipImageClassify(APP_ID, API_KEY, SECRET_KEY)
#
# """ 读取图片 """
#
#
# def get_file_content(filePath):
#     with open(filePath, 'rb') as fp:
#         return fp.read()
#
#
# image = get_file_content('./img.png')
#
# """ 调用通用物体和场景识别 """
# data = client.advancedGeneral(image)
# print(data)
# # """ 如果有可选参数 """
# # options = {}
# # options["baike_num"] = 5
# #
# # """ 带参数调用通用物体和场景识别 """
# # client.advancedGeneral(image, options)
